﻿package mortal.game.proxy
{
    import Message.Game.*;
    import Message.Public.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.mvc.core.*;

    public class TowerProxy extends Proxy
    {

        public function TowerProxy()
        {
            return;
        }// end function

        public function getTowerTopList() : void
        {
            rmi.iCopy.getTowerTopList_async(new AMI_ICopy_getTowerTopList(this.updateTowerTopList));
            return;
        }// end function

        private function updateTowerTopList(param1:AMI_ICopy_getTowerTopList, param2:STowerTopListMsg) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.TowerPublicTowerTopListUpdate, param2);
            return;
        }// end function

        public function enterTowerCopy(param1:int, param2:int) : void
        {
            rmi.iCopy.enterTowerCopy2_async(new AMI_ICopy_enterTowerCopy2(this.enterTowerCopy2Succeed), param1, param2);
            return;
        }// end function

        private function enterTowerCopy2Succeed(param1:AMI_ICopy_enterTowerCopy2) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.TowerCopy2EnterSucceed, null);
            return;
        }// end function

        public function resetTowerCopy(param1:int) : void
        {
            rmi.iCopy.resetTowerCopy_async(new AMI_ICopy_resetTowerCopy(), param1);
            return;
        }// end function

        public function scanTowerCopy(param1:int) : void
        {
            rmi.iCopy.scanTowerCopy_async(new AMI_ICopy_scanTowerCopy(this.scanTowerCopySucceed, null, param1), param1);
            return;
        }// end function

        private function scanTowerCopySucceed(param1:AMI_ICopy_scanTowerCopy) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(EventName.TowerGetStatus, param1.userObject as int));
            return;
        }// end function

        public function getTowerScanReward(param1:int) : void
        {
            rmi.iCopy.getTowerScanReward_async(new AMI_ICopy_getTowerScanReward(this.getTowerScanRewardSucceed, null, param1), param1);
            return;
        }// end function

        private function getTowerScanRewardSucceed(param1:AMI_ICopy_getTowerScanReward) : void
        {
            cache.copy.tower.delAllMoney(param1.userObject as int);
            NetDispatcher.dispatchCmd(ServerCommand.TowerScanRewardSucceed, null);
            return;
        }// end function

        public function getTowerScanStatus(param1:int) : void
        {
            rmi.iCopy.getTowerScanStatus_async(new AMI_ICopy_getTowerScanStatus(this.getTowerScanStatusSucceed, null, param1), param1);
            return;
        }// end function

        private function getTowerScanStatusSucceed(param1:AMI_ICopy_getTowerScanStatus, param2:int) : void
        {
            NetDispatcher.dispatchCmd(ServerCommand.TowerScanStatusRes, {copyCode:param1.userObject, lv:param2});
            return;
        }// end function

        public function goToGroupTowerLevel(param1:int, param2:int) : void
        {
            rmi.iCopy.goToGroupTowerLevel_async(new AMI_ICopy_goToGroupTowerLevel(this.enterNextSuss), param1, param2);
            return;
        }// end function

        private function enterNextSuss(param1:AMI_ICopy_goToGroupTowerLevel) : void
        {
            return;
        }// end function

    }
}
